﻿using SlamDunk.MES.IAppService.DTOs.Outputs.FoundationContext;
using SlamDunk.MES.IAppService.DTOs.Outputs.ResourceContext;
using SlamDunk.MES.Presentation.Models.NotifyModels;

namespace SlamDunk.MES.Presentation.Maps
{
    /// <summary>
    /// ID/名称映射
    /// </summary>
    public static class IdentiferNameMap
    {
        /// <summary>
        /// 工厂模型
        /// </summary>
        public static IdentiferNameNm ToIdentiferName(this FacilityInfo facilityInfo)
        {
            return new IdentiferNameNm(facilityInfo.Id, facilityInfo.Name);
        }

        /// <summary>
        /// 人员
        /// </summary>
        public static IdentiferNameNm ToIdentiferName(this PersonInfo personInfo)
        {
            return new IdentiferNameNm(personInfo.Id, personInfo.Name);
        }

        /// <summary>
        /// 班组
        /// </summary>
        public static IdentiferNameNm ToIdentiferName(this TeamInfo teamInfo)
        {
            return new IdentiferNameNm(teamInfo.Id, teamInfo.Name);
        }

        /// <summary>
        /// 设备
        /// </summary>
        public static IdentiferNameNm ToIdentiferName(this EquipmentInfo equipmentInfo)
        {
            return new IdentiferNameNm(equipmentInfo.Id, equipmentInfo.Name);
        }

        /// <summary>
        /// 物料定义
        /// </summary>
        public static IdentiferNameNm ToIdentiferName(this MaterialInfo materialInfo)
        {
            return new IdentiferNameNm(materialInfo.Id, materialInfo.Name);
        }

        /// <summary>
        /// 企业
        /// </summary>
        public static IdentiferNameNm ToIdentiferName(this EnterpriseInfo enterpriseInfo)
        {
            return new IdentiferNameNm(enterpriseInfo.Id, enterpriseInfo.Name);
        }
    }
}
